<!DOCTYPE html>
<html lang="en" xmlns:th="http://thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link th:replace="/common/common::common-head">

</head>
<body>
<base target="_parent"/>
<!--blogViews-->
<ul class="flow-default" id="LAY_demo1">

</ul>


<div th:replace="/common/common :: #common-js"></div>
<!--/**首页博客显示**/-->
<script>



    $(document).ready(function () {
        var sessionBlogTitle = sessionStorage.getItem('blogTitle');
        var LAY_demo1 = new Vue({
            el: '#LAY_demo1',
            data: {
                blogTitle: sessionBlogTitle,
            }
        })

        $.post({
            url: "queryBlogStatusList",
            data: {
                "blogTitle": sessionBlogTitle
            },
            success:function (data) {//渲染页面  根据博客标题查询

                //模拟数据插入
                var demo = data.data.items;;//将json拆分

                for (var i=0;i<demo.length;i++){
                    $('#LAY_demo1').append(
                        '<a href="' + 'homeBlog/' + demo[i].blogId + '">' +
                            '<div class="layui-row" style="margin-top: 1%;padding: 5px;">\n' +
                            '    <div class="layui-col-lg8 layui-col-md8 layui-col-sm12 layui-col-xs12  layui-col-lg-offset2 layui-col-md-offset2">\n' +
                            '        <div class="layui-panel">\n' +
                            '            <div class="layui-card-header" style="padding: 20px 30px;">\n' +
                            '                <b class="blogTitle layui-col-lg4 layui-col-md4 layui-col-sm4 layui-col-xs4">' + demo[i].blogTitle + '</b>\n' +
                            '                <span class="blogTitle layui-col-lg2 layui-col-md2 layui-col-sm2 layui-col-xs2 layui-col-lg-offset2 layui-col-md-offset2  layui-col-sm-offset2 layui-col-xs-offset2" style="background: rgba(243,240,240,0.69);padding: 8px 8px;border-radius: 10px;">' + demo[i].blogMemo + '</span>\n' +
                            '            </div>\n' +
                            '            <div class="layui-card-body">\n' +
                            '                <div class="value">\n' +
                            '                    ' + demo[i].blogValue + '\n' +
                            '                </div>\n' +
                            '            </div>\n' +
                            '            <div class="layui-card-header blogMemo" style="padding: 5px 30px;">\n' +
                            '                <span>' + demo[i].userName + '</span>\n' +
                            '                &nbsp;&nbsp;<i class="fa fa-code"></i>&nbsp;&nbsp;\n' +
                            '                <span>' + demo[i].blogDate + '</span>\n' +
                            '            </div>\n' +
                            '        </div>\n' +
                            '    </div>\n' +
                            '</div>' +
                        '</a>')

                }




            }
        })
    });

</script>
</body>
</html>